package cn.crism.ssc.controller;

import cn.crism.ssc.entity.Account;
import cn.crism.ssc.form.LoginForm;
import cn.crism.ssc.util.ResultVOUtil;
import cn.crism.ssc.vo.ResultVO;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import javax.validation.Valid;

@RestController
@CrossOrigin
public class LoginController {

    @GetMapping("/user")
    public ResultVO Hello(@RequestParam("name") String name,
                          @RequestParam("call") String call) {
        return ResultVOUtil.success();
    }

    @GetMapping("/hello")
    public void Hello1() {
        System.out.println("name:   call: dadsadad");
    }

    @PostMapping("/login")
    public ResultVO login(@RequestBody @Valid LoginForm loginForm, HttpSession session) {

        return ResultVOUtil.error(1, "登录失败！");
    }

}
